<?php

namespace App\HttpController\Api;

use App\HttpController\Api\BaseController;
use App\Logic\Order\OrderService;

/**
 * Class Order 订单
 */
class Order extends BaseController {
    /**订单列表     */
    public function index()
    {
        $service      = new OrderService();
        $result       = $service->getLists($this->request());
        return $this->writeJsonByOutput($result);
    }
    /**订单相关字典项目     */
    public function dict()
    {
        $service      = new OrderService();
        $result       = $service->getDict($this->request());
        return $this->writeJsonByOutput($result);
    }
    /**创建订单*/
    public function create()
    {
        $service      = new OrderService();
        $data         = $this->getJson();
        $result       = $service->create($data);
        return $this->writeJsonByOutput($result);
    }
    /**创建订单-自动获取账号*/
    public function createWithAutoAccount()
    {
        $service      = new OrderService();
        $data         = $this->getJson();
        $result       = $service->createOrderAutoAccount($data);
        return $this->writeJsonByOutput($result);
    }


}
